#ifndef _DANIEL_KERR_GLTEXT_H
#define _DANIEL_KERR_GLTEXT_H

#include "driver.h"

void writeText(GLfloat x,GLfloat y,GLfloat x_scale,GLfloat y_scale,
			   string text)
{
		glPushMatrix();
			glTranslatef(x,y,0);
			glScalef(x_scale,-y_scale,0.0);
				for(unsigned int q=0;q<text.size();++q)
				{glutStrokeCharacter(GLUT_STROKE_ROMAN,text[q]);}
		glPopMatrix();
}

void writeText(GLfloat x,GLfloat y,GLfloat x_scale,GLfloat y_scale,
			   GLfloat y_space,vector <string> text)
{
	for(unsigned int p=0;p<text.size();++p)
	{
		glPushMatrix();
			glTranslatef(x,y+(y_space*(p+1)),0);
			glScalef(x_scale,-y_scale,0.0);
				for(unsigned int q=0;q<text[p].size();++q)
				{glutStrokeCharacter(GLUT_STROKE_ROMAN,text[p][q]);}
		glPopMatrix();
	}
}

static string gitoa(int num, int maxlen=50)
{
	char* buf = new char[maxlen];
		_itoa_s(num,buf,maxlen,10);
	string ret(buf);
	delete buf;
	return ret;
}

#endif